<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page isELIgnored="false"%>
<link href="<c:url value="/resources/bootstrap/2.3.2/css/bootstrap.css" />" rel="stylesheet">
<link href="<c:url value="/resources/bootstrap/2.3.2/css/bootstrap-responsive.css" />" rel="stylesheet">

<title>模拟订票客户端更新客户资料</title>
<style>
 	input[type='text'],input[type='password']{
		height: auto;
    }

</style>
</head>

<body>
	<div class="container-fluid">
		<div class="row-fluid">
			<h2>票务系统——获取客户资料并更新 </h2>
			<hr>
			
			<div>
				这里只提供模拟提交，具体内容都是测试数据，写死固定，使用ajax方式提交json串。
			</div>
			<div>
			<button type="button" id="saveBtn" class="btn btn-success">提交</button>
			</div>
		</div>
	</div>
	<!--/row-->
</body>

<script src="<c:url value="/resources/jquery/1.9.1/jquery.min.js" />"></script>
<script src="<c:url value="/resources/bootstrap/2.3.2/js/bootstrap.min.js" />"></script>
<script type="text/javascript" src="<c:url value="/resources/bootstrap/bootstrap-validation.js" />"></script>
<script type="text/javascript">
	$(document).ready(function(){
		
		//获取会员客户资料
		$.ajax({
			url:'<c:url value="/api/ticket/customer" />',
			type:'get',
			dataType:'json',
			contentType : 'application/json',  
			success:function(data){
				console.log(data);
			}
		})
	
		$("#saveBtn").click(function(){
			
			var mydata = '';
			mydata += '{';
			mydata += '"name":"小李",';
			mydata += '"address":"广东深圳",';
			mydata += '"link":"154788412",';
			mydata += '"description_mc":"爱好和平"';
			mydata += '}'; 
			
			
            console.log(mydata);
			$.ajax({
				url:'<c:url value="/api/ticket/customer" />',
				type:'post',
				dataType:'json',
				contentType : 'application/json',  
				data:mydata,
				success:function(data){
					console.log(data);
				}
			})
		})
	})
	
</script>